from flask import Flask
import cgi
import httplib
app = Flask(__name__)

@app.route("/")
def index():
    return '<h1>Hello World!</h1>'

# @app.route("/user/<name>")
# def user(name):
#     return '<h1>Hello %s!</h1>' % name

@app.route('/user/<name>/<age>')
def user(name, age):
    return "<h1> Hello, %s, you're %s years old" % (name, age)

@app.route('/post/<int:post_id>')
def show_post(post_id):
    # show the post with the given id, the id is an integer
    return 'Post %d' % post_id


@app.route('/path/<path:subpath>')
def show_subpath(subpath):
    # show the subpath after /path/
    return 'Subpath %s' % cgi.escape(subpath)


@app.route('/login', methods=['GET', 'POST'])
def login():
    requests.api.sessions
    return 'lt'

if __name__ == '__main__':
    app.run()